Skip to content

Adaptive Replacement Cache (ARC)#5116

Closed
devxadarsh wants to merge 21 commits into
TheAlgorithms:masterfrom
devxadarsh:master
Closed

Adaptive Replacement Cache (ARC)#5116
devxadarsh wants to merge 21 commits into
TheAlgorithms:masterfrom
devxadarsh:master

Conversation

@devxadarsh
Copy link
Copy Markdown

@devxadarsh devxadarsh commented Apr 23, 2024

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized it.
  • All filenames are in PascalCase.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
  • All new code is formatted with clang-format -i --style=file path/to/your/file.java

@sozelfist
Copy link
Copy Markdown
Contributor

Have you read the CONTRIBUTING.md correctly? It would help if you wrote parametrized tests in a separate file in the test directory. You can refer to current implementations in this repository to know how to write tests.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 23, 2024

Codecov Report

Attention: Patch coverage is 62.00000% with 19 lines in your changes are missing coverage. Please review.

Project coverage is 38.65%. Comparing base (1607421) to head (5b68052).

Files Patch % Lines
.../thealgorithms/datastructures/caches/ARCCache.java 62.00% 16 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5116      +/-   ##
============================================
+ Coverage     38.56%   38.65%   +0.08%     
- Complexity     2378     2388      +10     
============================================
  Files           516      517       +1     
  Lines         15313    15363      +50     
  Branches       2957     2963       +6     
============================================
+ Hits           5906     5938      +32     
- Misses         9121     9137      +16     
- Partials        286      288       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment thread src/main/java/com/thealgorithms/datastructures/caches/ARCCache.java Outdated
Comment thread src/main/java/com/thealgorithms/datastructures/caches/ARCCache.java
Comment thread src/main/java/com/thealgorithms/datastructures/caches/ARCCache.java Outdated
Comment thread src/main/java/com/thealgorithms/datastructures/caches/ARCCache.java Outdated
Comment thread src/main/java/com/thealgorithms/datastructures/caches/ARCCache.java Outdated
@sozelfist
Copy link
Copy Markdown
Contributor

Please ensure that tests are added to handle lines with partial coverage.

Copy link
Copy Markdown
Author

@devxadarsh devxadarsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed and update the code

@sozelfist
Copy link
Copy Markdown
Contributor

You should format the code. LGTM

devxadarsh and others added 11 commits April 28, 2024 18:25
It aims to provide better performance compared to traditional caching algorithms like LRU (Least Recently Used) and LFU (Least Frequently Used).
Main Method Removed for ARCCache.java
Test cases added for the ARC
….java

Co-authored-by: SOZEL <80200848+TruongNhanNguyen@users.noreply.github.com>
….java

Co-authored-by: SOZEL <80200848+TruongNhanNguyen@users.noreply.github.com>
….java

Co-authored-by: SOZEL <80200848+TruongNhanNguyen@users.noreply.github.com>
….java

Co-authored-by: SOZEL <80200848+TruongNhanNguyen@users.noreply.github.com>
Replaced private final p(Pivot) using
private final int t1Capacity;
private final int b1Capacity;
adjustCacheSize();
updated test case for t1capacity and b1 capacity
@devxadarsh devxadarsh requested a review from sozelfist May 1, 2024 09:16
Copy link
Copy Markdown
Author

@devxadarsh devxadarsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated comments

@sozelfist
Copy link
Copy Markdown
Contributor

Please format your code using clang-format.

Comment thread src/main/java/com/thealgorithms/datastructures/caches/ARCCache.java Outdated
Comment thread src/main/java/com/thealgorithms/datastructures/caches/ARCCache.java Outdated
Comment thread src/main/java/com/thealgorithms/datastructures/caches/ARCCache.java
@devxadarsh devxadarsh requested a review from vil02 May 8, 2024 08:22
@vil02
Copy link
Copy Markdown
Member

vil02 commented May 9, 2024

Please add the missing tests and update your branch.

@github-actions
Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution!

@github-actions github-actions Bot added the stale label Jun 25, 2024
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jul 2, 2024

Please reopen this pull request once you have made the required changes. If you need help, feel free to ask in our Discord server or ping one of the maintainers here. Thank you for your contribution!

@github-actions github-actions Bot closed this Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants